package com.huan.springcloud.mongo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LetterPage {
    private long totalpage;//总页数
    private long currentpage;//当前页
    private long totalcount;//总数
    private long pagesize;//页面大小
    private List<Letter> letters;
    public void setPagesize(int psize){
        this.pagesize=psize;
        totalpage=totalcount%pagesize!=0?totalcount/pagesize+1:totalcount/pagesize;//这段代码一定要在pagesize复制后执行
    }
}